<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018/7/11 0011
  Time: 下午 4:48
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<html>
<head>
    <title>Title</title>

    <script src="../../js/jquery-3.3.1.min.js" charset="utf-8"></script>
    <script src="../../js/cookie/jquery.cookie.js" charset="utf-8"></script>
    <script src="../../layui-v2.4.5/layui/layui.js" charset="utf-8"></script>
    <link rel="stylesheet" href="../../layui-v2.4.5/layui/css/layui.css" media="all">
    <style>
        .mingcheng{
            display: flex;
            margin: 50px 0 -63px 0;
        }
        .liebiao{
            margin: 0;
            padding: 1px 15px 9px 15px;
        }
    </style>
</head>
<body>
<div class="layui-form" action="">
    <div class="layui-form-item mingcheng" >
        <label class="layui-form-label">卡名字</label>
        <div class="layui-input-block liebiao" >
            <select name="type" id="type"  lay-search>
                <option value="">全部</option>
                <option value="YJF" <c:if test="${type eq 'YJF'}">selected</c:if> >易缴费</option>
                <option value="XK" <c:if test="${type eq 'XK'}">selected</c:if> >闲卡</option>
                <option value="SK" <c:if test="${type eq 'SK'}">selected</c:if> >收卡啦</option>
            </select>
        </div>

        <div class="layui-inline"> <!-- 注意：这一层元素并不是必须的 -->
            <div class="layui-input-block liebiao" >
                <input type="text" class="layui-input" id="date" value="${date}">
            </div>

        </div>


        <div class="layui-btn layui-btn-small">
            <button type="button" class="layui-btn" onclick="search()">搜索</button>
        </div>
        <div style="margin: 0 0 0 50%;">
            <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right;margin-right: 100px"  href="javascript:location.replace(location.href);" title="刷新">
                <i class="layui-icon" style="line-height:30px">刷新</i></a>
        </div>
    </div>
</div>
<script>
    /*搜索*/
    function search() {
        window.location.href="/shop/statisticsInfo?type="+$("#type").val()+"&date="+$("#date").val();
    }


</script>

<script>
    layui.use('laydate', function(){
        var laydate = layui.laydate;

        //执行一个laydate实例
        laydate.render({
            elem: '#date' //指定元素
        });
    });
</script>

<br>
<br>
<br>

<table class="layui-hide" id="test" lay-filter="test"></table>

<script>
    layui.use('table', function(){
        var table = layui.table;

        table.render({

            elem: '#test'
            ,url:'/shop/statisticsInfoData?type=${type}&date=${date}'
            ,toolbar: '#toolbarDemo'
            ,title: '推卡详情'
            ,totalRow: true
            ,cols: [[
                {field:'id', title:'统计', width:100, fixed: 'left', unresize: true,  totalRowText: '合计'}
                ,{field:'className', title:'卡类别',  width:180, fixed: 'left', totalRow: true}
                ,{field:'allNumber', title:'总数量', width:180, fixed: 'left', totalRow: true}
                ,{field:'allSum', title:'总金额',  width:180, fixed: 'left',  totalRow: true}
                ,{field:'succeedNumber', title:'成功数量',width:180, fixed: 'left', totalRow: true  }
                ,{field:'succeedSum', title:'成功金额',width:180, fixed: 'left',  totalRow: true}
                ,{field:'fallNumber', title:'失败数量',width:180, fixed: 'left',totalRow: true}
                ,{field:'fallSum', title:'失败金额',width:180, fixed: 'left', totalRow: true}
            ]]
        });

    });
</script>


</body>
</html>
